import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from "pages/Index"
import Search from "pages/search/Search"
import Home from "pages/home/Home"
import Recommend from "pages/home/Recommend"
import Albums from "pages/home/Albums"
import Catalogs from "pages/home/Catalogs"
import Sound from "pages/sound/Sound"
import SoundIntro from "pages/sound/SoundIntro"
import SoundComments from "pages/sound/SoundComments"
import SoundPic from "pages/sound/SoundPic"
import Rank from "pages/rank/Rank"
import AlbumList from "pages/albumList/AlbumList"
import CatalogList from "pages/catalogs/CatalogList"
import SearchList from "pages/search/SearchList"
import Unity from "pages/search/Unity"
import Drama from "pages/search/Drama"
import Live from "pages/search/Live"
import "assets/reset.css"
import "assets/swiper.min.css"
import "assets/styls/style.styl"
import "assets/animation.css"
import 'vant/lib/button/style'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component:Index,
    children:[
      {
        path:'/search',
        name:'search',
        component:Search
      },
      {
        path:"/searchList/:keyword",
        name:'searchList',
        component:SearchList,
        redirect:"/searchList/:keyword/unity",
        children:[{
          path:'unity',
          name:"unity",
          component:Unity
        },
        {
          path:'drama',
          name:"drama",
          component:Drama
        },
        {
          path:'live',
          name:"live",
          component:Live
        },
        {
          path:'albums',
          name:"albums",
          component:Unity
        },
        {
          path:'up',
          name:"up",
          component:Unity
        }]
      },
      {
        path:'/',
        name:'home',
        component:Home,
        children:[
          {
            path:'recommend',
            name:'recommend',
            meta:2,
            component:Recommend
          },
          {
            path:'albums/:id?',
            name:'albums',
            meta:1,
            component:Albums
          },
          {
            path:'catalogs',
            name:'catalogs',
            meta:3,
            component:Catalogs
          }
        ],
        redirect:"recommend"
      },
      {
        path:'/sound/:soundid',
        name:'sound',
        props:true,
        component:Sound,
        redirect:"/sound/:soundid/soundIntro",
        children:[
          {
            path:"soundIntro",
            name:'soundIntro',
            component:SoundIntro
          },
          {
            path:"soundComments",
            name:'soundComments',
            component:SoundComments
          },
          {
            path:"soundPic",
            name:'soundPic',
            component:SoundPic
          }
        ]
      },
      {
        path:'rank',
        name:'rank',
        component:Rank
      },
      {
        path:'album/:id',
        name:"album",
        component:AlbumList
      },
      {
        path:'catalog/:id',
        name:"catalog",
        component:CatalogList
      }
    ]
  }
  
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
